// Simple program to demonstrate the use of conditionals in C++
#include <iostream>
#include <string>

int main()
{
  int num;
  std::string str1 = "Hello, World!\n";
  std::string str2 = "Goodbye, World!\n";

  std::cout << "Enter either 1 or 2:\n";
  std::cin >> num;

  // Use == to test for equality (2 EQUALS NOT 1!):
  if(num == 1)
    std::cout << str1;
  else if(num == 2)
    std::cout << str2;
  else
    std::cout << "You didn't enter 1 or 2\n";

  std::cout << "Do you want me to print both strings?\n"
	    << "(0: no, any other integer: yes)\n";
  std::cin >> num;

  // In C++, the integer zero is false, and any other integer is true.
  if(num) {
    std::cout << str1;
    std::cout << str2;
  } else {
    std::cout << "I won't print ";
    std::cout << "either string.\n";
  }

  return 0;
}
